<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
	<div class="container-fluid">
		<div class="navbar-header">
			<div>
				<a class="navbar-brand" style="font-size: 32px;" href="#">众筹平台 -
					控制面板</a>
			</div>
		</div>
		<div id="navbar" class="navbar-collapse collapse">
			<ul class="nav navbar-nav navbar-right">
				<li style="padding-top: 8px;">
					<div class="btn-group">
						<button type="button"
							class="btn btn-default btn-success dropdown-toggle"
							data-toggle="dropdown">
							<i class="glyphicon glyphicon-user"></i>
							${sessionScope.loginAdmin.userName}
							<security:authentication property="principal.originalAdmin.userName"/>
							<span class="caret"></span>
						</button>
						<ul class="dropdown-menu" role="menu">
<%--							<li><a href="#"><i class="glyphicon glyphicon-cog"></i>--%>
<%--									个人设置</a></li>--%>
<%--							<li><a href="#"><i class="glyphicon glyphicon-comment"></i>--%>
<%--									消息</a></li>--%>
							<li class="divider"></li>
							<li>
								<%--			不禁用csrf--%>
								<form id="logoutForm" action="security/do/logout.html" method="post">
									<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
								</form>
									<a href="" id="logoutAnchor"><i
											class="glyphicon glyphicon-o"></i> 退出系统</a></li>
								<script type="text/javascript">
									window.onload = function() {
										// 给超链接的DOM对象绑定单击响应函数
										document.getElementById("logoutAnchor").onclick = function() {
											// 提交包含csrf参数的表单
											document.getElementById("logoutForm").submit();
											//超链接不跳转
											return false;
										};
									};
							</script>

<%--								<a href="security/do/logout.html"><i--%>
<%--									class="glyphicon glyphicon-o"></i> 退出系统</a></li>--%>
                        </ul>
                    </div>
                </li>
                <li style="ffmargin-left: 10px; padding-top: 8px;">
					<button type="button" class="btn btn-default btn-danger">
						<span class="glyphicon glyphicon-question-sign"></span> 帮助
					</button>
				</li>
			</ul>
			<form class="navbar-form navbar-right">
				<input type="text" class="form-control" placeholder="查询">
			</form>
		</div>
	</div>
</nav>